//
//  NET.h
//  KingSelected
//
//  Created by 杨鹏 on 2023/10/27.
//

#import <Foundation/Foundation.h>
#import "NetManager.h"

NS_ASSUME_NONNULL_BEGIN

extern NSString *baseUrl;

#define URL(path) [NSString stringWithFormat:@"%@/%@",baseUrl,path]

@interface NET : NSObject

/// 登录
+ (void)loginWithPhone:(NSString *)phone psd:(NSString *)password success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 发送验证码
+ (void)sendCode:(NSString *)phone success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 忘记密码验证码
+ (void)sendResetPsdCode:(NSString *)phone success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 注册
+ (void)registeWithPhone:(NSString *)phone code:(NSString *)code psd:(NSString *)psd success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 重置密码
+ (void)resetPasswordWithPhone:(NSString *)phone code:(NSString *)code psd:(NSString *)psd success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取用户信息
+ (void)getUserInfo:(NSString *)userId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 更新用户信息
+ (void)updateUserInfo:(NSString *_Nullable)avatar name:(NSString *_Nullable)name success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 上传头像
+ (void)uploadAvatar:(UIImage *)img success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取店铺商品或搜索
/// - Parameters:
///   - enable: 1 已上架 -1未上架 0全部
///   - goodsIntroduction_Like: 搜索内容
+ (void)getShopListWithPage:(NSInteger)page pageSize:(NSInteger)pageSize userId:(NSString *)userId enable:(NSInteger)enable goodsIntroduction_Like:(NSString *_Nullable)goodsIntroduction_Like success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 删除商品
+ (void)deleteShopWithGoodsId:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// enable NO下架 YES 上架
+ (void)topOrDownShopWithGoodsId:(NSString *)goodsId enable:(BOOL)enable success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 设置置顶
+ (void)topSetShopWithGoodsId:(NSString *)goodsId top:(BOOL)top success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 发布商品
+ (void)publishGoodsWithGoodsId:(NSString *_Nullable)goodsId goodsIntroduction:(NSString *)goodsIntroduction sellingPrice:(NSString *)sellingPrice imgUrl:(NSString *_Nullable)imgUrl imgThumbnailUrl:(NSString *_Nullable)imgThumbnailUrl video:(NSString *_Nullable)video videoImgUrl:(NSString *_Nullable)videoImgUrl success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取关注列表
+ (void)getFollowList:(NSNumber *)page size:(NSNumber *)pageSize success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 关注
+ (void)followUser:(NSString *)idolUserId flag:(BOOL)isFollow status:(NSInteger)status success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 置顶
+ (void)topUser:(NSString *)userId type:(BOOL)type success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 搜索
+ (void)searchUser:(NSString *)nickName pageNumber:(NSNumber *)pageNumber pageSize:(NSNumber *)pageSize success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取商品详情
+ (void)getGoodsInfoWithGoodsId:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 动态页面的商品列表
+ (void)getDynamicGoodsList:(NSNumber *)page pageSize:(NSNumber *)pageSize searchStr:(NSString *_Nullable)goodsIntroduction_Like success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取公告
+ (void)getNoticeDataSuccess:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

+ (void)getQrcodeSuccess:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 一键转发
+ (void)forwardGoodsWithGoodsId:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 同步更新商品
+ (void)updateGoodsWithGoodsId:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 售罄
+ (void)soldOutWithGoodsId:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 拉黑用户
+ (void)blackUser:(NSString *)userId type:(int)type success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 用户列表
+ (void)getBlackListSuccess:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 获取商品二维码
+ (void)getGoodsQrCode:(NSString *)goodsId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 批量置顶
+ (void)topAllWithGoodsIds:(NSString *)goodsIds success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 批量上下架
+ (void)topDownAllWithGoodsIds:(NSString *)goodsIds enable:(NSInteger)enable success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 批量删除
+ (void)deleteAllWithWithGoodsIds:(NSString *)goodsIds success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

/// 设置跟随商家全自动半自动
+ (void)followSetType:(NSInteger)type userId:(NSString *)userId success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;


@end

NS_ASSUME_NONNULL_END
